package cn.xorange.commons.system.entity.system;

import cn.xorange.commons.data.annotation.MColumn;
import cn.xorange.commons.data.constants.KeyType;
import cn.xorange.commons.data.core.entity.DataEntity;
import cn.xorange.commons.utils.validate.MValidate;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

/**
 * @author : yangjian
 * @date : 2022/2/22
 */
@Data
public class SysRole extends DataEntity {

    @TableId(type = IdType.AUTO)
    @MColumn(key = KeyType.AUTO)
    private Long roleId;
    @MColumn
    @MValidate(nonNull = true)
    private String roleName;
    /**角色权限字符串*/
    @MColumn(name = "roleKey")
    @MValidate(repeatSearch = {"role_key","tenant_id"})
    private String roleKey;

    @MColumn(canNull = true)
    private String dataScope;
    /** 所属机构ID */
    @MColumn
    private Long tenantId;
    private String tenantName;
    @MColumn(canNull = true)
    private String remark;
    @MColumn
    private Integer sort;
    @MColumn
    private String allowed;
    @MColumn
    private String status;
    @MColumn
    private Long createById;
}
